<?php
/**
 * Created by PhpStorm.
 * User: andrei
 * Date: Jun 27, 2012
 * Time: 4:07:51 PM
 * To change this template use File | Settings | File Templates.
 */
 
class Db_Products_ProductPageTexts extends Common {
	protected static $tableName = TAB_PRODUCT_PAGE_TEXTS;
	protected static $dbFields = array(
        'id',
		'ppt_product_page_id',
		'ppt_layout_item_id',
		'ppt_text',
		'ppt_font_family',
		'ppt_font_size',
		'ppt_text_align',
		'ppt_vertical_align',
		'ppt_line_height',
		'ppt_color',
        'deleted'
	);

	/**
	 * @var Db_Products_ProductPageTexts
	 */
	public $objectArray;

	public $id;
	public $ppt_product_page_id;
	public $ppt_layout_item_id;
	public $ppt_text;
	public $ppt_font_family;
	public $ppt_font_size;
	public $ppt_text_align;
	public $ppt_vertical_align;
	public $ppt_line_height;
	public $ppt_color;
    public $deleted;

    function __construct($value=NULL, $fieldName=NULL) {
        parent::__construct($value, $fieldName);
    }

	public static function deleteByLiIds($liIds = array()) {
		$liIdsList = implode(',', $liIds);
		self::$DB->q("DELETE FROM ?f WHERE `ppt_layout_item_id` IN(?) AND `deleted` = 0 ;", self::$tableName, $liIdsList);

        return (self::$DB->mysqlModifiedRows() > 0 ? true : false);
	}
}